﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace H.Configs
{
    /// <summary>
    /// 用户数据存储接口,主要是用于用户数据的存储
    /// </summary>
    public interface IConfig
    {
        /// <summary>
        /// 配置文件
        /// </summary>
        /// <param name="key">键</param>
        /// <returns>值</returns>
        string this[string key] { get; set; }

        /// <summary>
        /// 根据指定的键读取一个值
        /// </summary>
        /// <param name="key">键</param>
        /// <returns>读取到的值</returns>
        string GetString(string key);

        /// <summary>
        /// 获取一个值为Int32数据
        /// </summary>
        /// <param name="key">键</param>
        /// <param name="defaultValue">默认值</param>
        /// <returns>读取到的值</returns>
        int GetInt(string key, int defaultValue);

        /// <summary>
        /// 保存一个字符串值
        /// </summary>
        /// <param name="key">键</param>
        /// <param name="value">值</param>
        void Set(string key, string value);


        /// <summary>
        /// 保存一个整形值
        /// </summary>
        /// <param name="key">键</param>
        /// <param name="value">值</param>
        void Set(string key, int value);
    }
}
